<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<form action="" id="form">
    <input type="submit" value="Submit Form">
    <button type="submit">Submit Form</button>
    <input type="image" src="./images/img1.jpg" width="100px">
</form>

<script>
    /*
        几种提交方式,如上
     */
    let form = document.querySelector('#form')
    form.addEventListener('submit',(event) =>{
        console.log('别提交了...')
        // 阻止提交表单
        event.preventDefault();
    })
    
    // 第二种
    // form.submit();

</script>
</body>
</html>